package com.xxbb.util.tool;

import java.util.Scanner;

public class Tool {
	public static String input() {
		Scanner scanner = new Scanner(System.in);
		return scanner.nextLine();
	}
	public static String input(String hint) {
		System.out.print(hint);
		Scanner scanner = new Scanner(System.in);
		return scanner.next();
	}
	//打印
	public static void  print(Object... value) {
		if (value != null && value.length > 0) {
			for (int i = 0; i < value.length; i++) {
				System.out.print(value[i]);
			}
		}  else {
			System.out.print(value);
		}
	}
	public static void  println(Object... value) {
		if (value != null && value.length > 0) {
			for (int i = 0; i < value.length; i++) {
				System.out.println(value[i]);
			}
		}  else {
			System.out.println(value);
		}
	}
	//打印日志
	public static void log(Object... value) throws IllegalAccessError {
		/*
		 * for (StackTraceElement i : Thread.currentThread().getStackTrace()) {
		 * System.out.println(i); }
		 */
		//输出调用位置

		if (value != null && value.length > 0) {
			for (int i = 0; i < value.length; i++) {
				System.out.print(value[i]);
				System.out.println("\tat "+Thread.currentThread().getStackTrace()[2]);
			}
		}  else {
			System.out.print(value);
			System.out.println("\tat "+Thread.currentThread().getStackTrace()[2]);
		}
	}
	public static Integer Integer(String valueString){
		return Integer.parseInt(valueString);
	}
}
